<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>管理中心 - Powered By BETOU.NET</title>
<meta http-equiv="expires" content="0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="author" content="BETOU.NET Team" />
<meta name="copyright" content="BETOU.NET" />
<link href="${base}/res/betou/css/common.css" rel="stylesheet" type="text/css"/>
<link href="${base}/res/betou/css/login.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="${base}/res/common/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${base}/res/common/js/common.js"></script>
<script type="text/javascript">
	$().ready( function() {
		
		<#if errors??>
			var errorsmessages = '<#list errors as error>${error}</#list>';
			$.message("error", errorsmessages);
		</#if>
		
		var $loginForm = $("#loginForm");
		var $enPassword = $("#enPassword");
		var $username = $("#username");
		var $password = $("#password");
		var $captcha = $("#captcha");
		var $captchaImage = $("#captchaImage");
		var $isRememberUsername = $("#isRememberUsername");
		
		// 记住用户名
		if(getCookie("adminUsername") != null) {
			$isRememberUsername.prop("checked", true);
			$username.val(getCookie("adminUsername"));
			$password.focus();
		} else {
			$isRememberUsername.prop("checked", false);
			$username.focus();
		}
		
		// 更换验证码
		$captchaImage.click( function() {
			$captchaImage.attr("src", "${base}/captcha.svl?d=" + (new Date()).valueOf());
		});
		
		// 表单验证、记住用户名
		$loginForm.submit( function() {
			if ($username.val() == "") {
				$.message("warn", "请输入您的用户名");
				$username.focus();
				return false;
			}
			if ($password.val() == "") {
				$.message("warn", "请输入您的密码");
				$password.focus();
				return false;
			}
			<#if errorRemaining?? && errorRemaining<=0>
			if ($captcha.val() == "") {
				$.message("warn", "请输入您的验证码");
				$captcha.focus();
				return false;
			}
			</#if>
			if ($isRememberUsername.prop("checked")) {
				addCookie("adminUsername", $username.val(), {expires: 7 * 24 * 60 * 60});
			} else {
				removeCookie("adminUsername");
			}
		});
	});
</script>

</head>
<body>
	
		<div class="login">
			<form id="loginForm" action="login.do" method="post">
			<#if returnUrl??><input type="hidden" name="returnUrl" value="${returnUrl}"/></#if>
			<#if processUrl??><input type="hidden" name="processUrl" value="${processUrl}"/></#if>
				<table>
					<tr>
						<td width="190" rowspan="2" align="center" valign="bottom">
							<img src="${base}/res/betou/images/login_logo.gif" alt="BETOU.NET" />
						</td>
						<th>
							<@s.m "login.username"/>:
						</th>
						<td>
							<input type="text" id="username" name="username" class="text" value="" maxlength="20" />
						</td>
					</tr>
					<tr>
						<th>
							<@s.m "login.password"/>:
						</th>
						<td>
							<input type="password" id="password" name="password" class="text" value="" maxlength="20" autocomplete="off" />
						</td>
					</tr>
					<#if errorRemaining?? && errorRemaining<=0>
						<tr>
							<td>
								&nbsp;
							</td>
							<th>
								<@s.m "login.captcha"/>:
							</th>
							<td>
								<input type="text" id="captcha" name="captcha" class="text captcha" maxlength="4" autocomplete="off" /><img id="captchaImage" class="captchaImage" src="${base}/captcha.svl?s=1" title="点击更换验证码" />
							</td>
						</tr>
					</#if>
					<tr>
						<td>
							&nbsp;
						</td>
						<th>
							&nbsp;
						</th>
						<td>
							<label>
								<input type="checkbox" id="isRememberUsername" value="true" />
								记住用户名
							</label>
						</td>
					</tr>
					<tr>
						<td>
							&nbsp;
						</td>
						<th>
							&nbsp;
						</th>
						<td>
							<input type="button" class="homeButton" value="" onclick="location.href='/'" /><input type="submit" class="loginButton" value="登录" />
						</td>
					</tr>
				</table>
				<div class="powered">COPYRIGHT © 2011-2014 BETOU.NET ALL RIGHTS RESERVED.</div>
				<div class="link">
					<a href="/">前台首页</a> |
					<a href="http://www.betou.net">官方网站</a> |
					<a href="http://bbs.betou.net">交流论坛</a> |
					<a href="http://www.betou.net/about.html">关于我们</a> |
					<a href="http://www.betou.net/contact.html">联系我们</a> 
				</div>
			</form>
		</div>
</body>
</html>